#include "MachineSpec.hpp"
/*
 * =============================================================
 *  			interface for M_get_macro_xxxxx
 *  ===========================================================
 */
enum Core M_get_macro_core(enum MACRO_ID id)
{
	if( P0 < id && id < P3)
		return CORE_X;
	if( ADDR_P0 < id  && id < ADDR_P3)
		return MU_U;
	assert("error" == "the macro_id is not expected");
}
enum TargetInfo::PhysicalRegister  M_get_macro_physical_register(enum MACRO_ID MacroId)
{
	//convert the  macroid to the physical register
	switch(MacroId)
	{
	case P0:
		return TargetInfo::XR0;
	case P1:
		return TargetInfo::XR1;
	case P2:
		return TargetInfo::XR2;
	case P3:
		return TargetInfo::XR3;
	case ADDR_P0:
		return TargetInfo::UR0;
	case ADDR_P1:
		return TargetInfo::UR1;
	case ADDR_P2:
		return TargetInfo::UR2;
	case ADDR_P3:
		return TargetInfo::UR3;
	default:
		assert("error" == "the macro_id is not expected ");
	}
}

bool M_is_macro_id(int id)
{
	if( P0 <= id && id <= INPUT_SP)
		return true;
	else
		return false;
}




